package com.zhdl.modules.process.verify;

import com.zhdl.modules.process.common.ProcessVerify;

public class DelayTimeVerify implements ProcessVerify {
    int timeout;
    long sTime = 0;

    public DelayTimeVerify(int timeout) {
        this.timeout = timeout;
    }

    @Override
    public boolean verity() {
        if (timeout<0){
            return true;
        }
        if (sTime == 0){
            sTime = System.currentTimeMillis();
        }
        if (System.currentTimeMillis() - sTime >= timeout) {
            sTime = 0;
            return true;
        }
        return false;
    }
}
